<template>
  <div>
    <el-carousel :interval="5000" height="1000px">
      <el-carousel-item v-for="(item, index) in list" :key="index">
        <img class="swiperImg" :src="item" alt="" />
      </el-carousel-item>
    </el-carousel>
  </div>
</template>
   
  <script>
import { getData } from "../util/getData";

export default {
  name: "lbtAaa",
  data() {
    return {
      list: [],
    };
  },
  async created() {
    let res = await getData({ url: "/gunlist/findlbt" });
    res = res.data.slice(0, 5);
    res.forEach((item) => {
      this.list.push(`${"/api"}/${item.photo}`);
    })
  },
};
</script>
  <style scoped >
.el-carousel__item h3 {
  width: 100%;
  color: #475669;
  font-size: 18px;
  opacity: 0.75;
  line-height: 300px;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
.swiperImg {
  display: block;
  object-fit: cover;
  object-position: center;
  height: 100%;
  width: 100%;
}
.el-carousel__container {
  height: 100% !important;
}
</style>